import service from '@/api/http'
const business_opportunity = {
    // 获取商机列表
    getBusinessOpportunityList(p) {
        return service.get('/business_opportunity', {
            params: p
        })
    },

    // 添加商机
    addBusinessOpportunity(p) {
        return service.put('/business_opportunity/add', p)
    },

    // 编辑商机
    editBusinessOpportunity(p) {
        return service.post('/business_opportunity/update', p)
    },

    // 删除商机
    deleteBusinessOpportunity(p) {
        return service.delete('/business_opportunity/delete', {
            params: p
        })
    },

    // 跟进阶段
    getStage() {
        return service.get('/business_opportunity/stage')
    },

    // 获取查询项销售人员
    getEmployee() {
        return service.get('/business_opportunity/emp')
    },

    // 获取查询项客户
    getCustomer() {
        return service.get('/business_opportunity/cust')
    },

    // 生成需求总结
    generateSummary(p) {
        if (!p.demand_desc) {
            return Promise.reject('请输入需求描述')
        }
        return service.post('/business_opportunity/summary', p)
    }
}

export default business_opportunity
